import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css'
import * as THREE from 'three';
import router from './router';

(window as any).THREE = THREE;

// 处理路由
const urlParams = new URLSearchParams(window.location.hash.substring(1));
const functionName = urlParams.get('functionName');

if (functionName) {
  App.config.globalProperties.$functionName = functionName;
}

createApp(App).use(router).use(ElementPlus).mount('#app').$nextTick(() => {
  // Use contextBridge
  window.ipcRenderer.on('main-process-message', (_event, message) => {
    console.log('消息：' + message)
  })
})
